home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 151-175 / scopedisk168 / asmmacros / am_02 / findtask.i < prev    next >
Text File  |  1995-03-19  |  2KB  |  73 lines

  1.      NOLIST
  2. FindTask    MACRO              ; 19 Dec 88
  3. *------------------------------; Start of FindTask macro.
  4.      NOLIST
  5.      IFC '\1','I'              ; If <PointerToTaskName> is specified, then
  6.      LIST
  7.                                ; Put <PointerToTaskName> in A1.
  8.      MOVEA.L #\2,A1
  9.      NOLIST
  10.      IFEQ ReEntrant-1
  11.      LIST
  12.      ADDA.L A5,A1
  13.      NOLIST
  14.      ENDC
  15.      ENDC
  16.      IFC '\1','D'              ; If <TaskName> is specified, then
  17.      LIST
  18.                                ; Make A1 point to the task name string.
  19.      MOVEA.L #\2.str,A1
  20.      NOLIST
  21.      IFND \2.str               ; Unless it was previously defined,
  22.      LIST
  23.      SECTION DataSection,DATA  ; The ASCII <TaskName> string goes here.
  24. \2.str:
  25.      DC.B '\2',0
  26.      CNOP 0,2
  27.      SECTION CodeSection,CODE
  28.      NOLIST
  29.      ENDC
  30.      ENDC
  31.      IFC '\1','Self'           ; If "Self" is specified, then
  32.      LIST
  33.      SUBA.L A1,A1              ; Clear A1 to indicate "Self".
  34.      NOLIST
  35.      ENDC
  36.      LIST
  37.      CallLib FindTask,exec     ; Call FindTask.
  38.                                ; Put the pointer to the task structure at
  39.                                ;  <TaskStructPtrName>.
  40.      NOLIST
  41.      IFC '\1','Self'
  42.      IFEQ ReEntrant-1
  43.      LIST
  44.      DefDS \2,1
  45.      MOVE.L D0,\2(A5)
  46.      NOLIST
  47.      ENDC
  48.      IFNE ReEntrant-1
  49.      LIST
  50.      DS_BSS \2,1,.L
  51.      MOVE.L D0,\2
  52.      NOLIST
  53.      ENDC
  54.      ENDC
  55.      IFNC '\1','Self'
  56.      IFEQ ReEntrant-1
  57.      LIST
  58.      DefDS \3,1
  59.      MOVE.L D0,\3(A5)
  60.      NOLIST
  61.      ENDC
  62.      IFNE ReEntrant-1
  63.      LIST
  64.      DS_BSS \3,1,.L
  65.      MOVE.L D0,\3
  66.      NOLIST
  67.      ENDC
  68.      ENDC
  69.      LIST
  70. *------------------------------; End of FindTask macro.
  71.      ENDM
  72.      LIST
  73.